package bma.common.langutil.jmshell.command;

import bma.common.langutil.jmshell.JMShellProcessor;
import bma.common.langutil.jmshell.Session;

public class CommandProcessorWrap extends CommandProcessor {

	protected String help;
	protected JMShellProcessor processor;

	public CommandProcessorWrap(String command) {
		super(command);
	}

	public JMShellProcessor getProcessor() {
		return processor;
	}

	public void setProcessor(JMShellProcessor processor) {
		this.processor = processor;
	}

	public String getHelp() {
		return help;
	}

	public void setHelp(String help) {
		this.help = help;
	}

	@Override
	public String getHelp(Session session) {
		return help == null ? "no help" : help;
	}

	@Override
	public boolean process(Session session, String command) {
		if (canHandle(session, command)) {
			return this.process(session, command);
		}
		return false;
	}
}
